#include "vertex.h"
#include <vector>

#define EXPERIMENTAL

class Heap
{
private:

	//float *heap;
	vector<Vertex> heap;
	int numElements;
	int heapSize;	
	vector<int> pos;

public:
	Heap();
	~Heap();

	void swap(int p1, int p2);
	int root(int position);
	int father(int position);
	Vertex key(int position);
	int left(int position);
	int right(int position);
	void heapfy_up(int p);
	void heapfy_down(int p);
	int findElementByKey_aux(Vertex v, int p);


public:

	Vertex deleteMin();
	void checkHeap(int p);
	bool isEmpty(){
		return numElements==0;
	}
	void incert(int n, int d);
	void incert(Vertex v);
	void removeElement(int p);
	int findElementByKey(Vertex v);
	void updatePosition(int p, Vertex v);
	void updateKey(Vertex v, int n);
	void printHeap(int p);
	
        double numHeapUp, numHeapDown, numFind;

};
